home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Risc World 3
/
Risc World 3.iso
/
SOFTWARE
/
ISSUE4
/
ZAP
/
!Zap
/
Modules
/
!ZapBasAsm
/
UK
/
HelpData
Wrap
Text File
|
2002-05-08
|
3KB
|
77 lines
| ZapBASasm
mode_basasm
Carl Hetherington's colouring mode for BASIC assembler.
This will colour the assembler parts of untokenised BASTXT files.
BASM_LABELLIST
This is the simplest of the three. When called it simply calls the Zap
search code with a search string that (hopefully) finds just label
definitions. These are sent to a throwback window for your perusal.
This option can be selected from the Mode.BasAsm menu.
BASM_MULTIPLE
This command is designed to find labels that have been defined more than once
within a particular file. Multiple definitions can give rise to all manner
of strange errors and its worth calling this function if you have a strange
bug that you can't fix. If any multiple definitions are found they are
listed in a throwback window; if labels are defined more than twice they
appear more and once in the throwback window. Note that in this version you
can't click on labels in the throwback window to move to them; you'll have to
use the standard search function once the multiple labels have been found.
This option can also be selected from the Mode.BasAsm menu.
Note that if you have labels longer than 256 characters in length then
strange things may happen.
BASM_NUMBERLABEL
This is a command which may or may not suit your way of working. Because of
the fact that you can't have duplicate labels in the BASIC assembler, I tend
to give common labels, for example loop and skip, consecutive numbers to
differentiate them. For example there might be a sequence of code
.routine_loop1
<code>
BNE routine_skip1
<code>
.routine_skip1
BLT routine_loop1
.routine_loop2
...etc
The only problem with this is knowing which numbers have been used and which
have not. This is where this command comes in. It is used when you have
typed the start of a new label, e.g.
.routine_loop
If you then call BASM_NUMBERLABEL, Zap will look through the file for any
other labels of the form routine_loopx, where x is a number, and will then
enter the next number up in the sequence.
This sounds rather complicated, but works quite well in practice. With the
above example of code, I could then type
.routine_skip
and then call BASM_NUMBERLABEL and a 2 would be entered.
Note that using numbers of more than 3 digits with this command may cause
unpredictable behaviour.
BASM_INSERTPREFIX
This is another command that may or may not help you, depending on the style
of source code that you write. Because of the way I avoid duplicate labels,
the label names can end up being rather long and tedious to type. The
BASM_INSERTPREFIX command, when bound to a handy key, can help. Basically it
tries to decide what the current subroutine that you are in is called, and
inserts this name at the cursor. This can be useful in situations like:
.a_long_routine_name
. [*] a_long_routine_name_loop1
MOV r0,r0
B [*] a_long_routine_name_loop1
Executing BASM_INSERTPREFIX at the places marked by [*] inserts
'a_long_routine_name'. The best way to understand it is to try it out; if it
doesn't work for you then just forget about it.